package com.chenfei.aop;

import com.chenfei.aop.service.BusinessService;
import com.chenfei.ioc.bean.FirstBean;
import com.chenfei.ioc.di.ConstructorBean;
import com.chenfei.ioc.di.SetBean;
import com.chenfei.ioc.di.SortBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author chenfei
 * @description
 * @since 2018/3/22
 */
public class MainAOP {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring-aop.xml");
        firstTest(context);
    }

    /**
     * spring第一个例子，通过xml文件初始化bean
     * @param context
     */
    public static void firstTest(ApplicationContext context){
        BusinessService businessService = context.getBean("businessService",BusinessService.class);
        businessService.bussiness();
    }



}
